# -----------------------------------------------------------    定义一个计算字符串长度的函数
str1 = "itheima"
str2 = "itcast"
str3 = "1234"

def my_len(data):
    count = 0
    for x in data:
        count += 1
    print(f"字符串{data}的长度为{count}")

my_len(str1)
my_len(str2)
my_len(str3)
# --------------------------
def say_hi(data):
    print("加油")
say_hi(1)
# ---------

def add(x,y):
    result = x + y
    print(f"{x} + {y} = {x + y}")
add(1,2)
add(7,0)

# -----------------
def check(x):
    print("欢迎光临，请出示健康码，并配合测量体温！")
    if x > 37.5:
        print(f"您的体温是：{x}，需要隔离！")
    else:
        print(f"您的体温是：{x}，体温正常，请进！")

check(29)
check(40)

# -------------------
def add(x,y):
    result = x + y
    return result
r = add(1,4)
print(r)

# --------------------                                     if no result
def check(age):
    if age > 18:
        return "SUCCESS"
    else:
        return None

result = check(16)
if not result:
    print("未成年，不准进入")